<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量的解构赋值</title>
</head>

<body>
    <script>
        // 1.数组的解构
        /* const F4 = ['小沈阳', '刘能', '赵四', '宋小宝'];
        let [xiao, liu, zhao, song] = F4;
        console.log(xiao);
        console.log(liu);
        console.log(zhao);
        console.log(song); */

        // 2.对象的解构
        const zhao = {
            name: '赵本山',
            age: '不详',
            composition: function () {
                console.log("我可以演小品");
            }
        };

        /* let { name, age, composition } = zhao;
        console.log(name);
        console.log(age);
        console.log(composition); */

        let { composition } = zhao;
        composition();
    </script>
</body>

</html>